package com.example.zhaohang.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.example.zhaohang.bingzhuangtu.QQAppApolication;

/**
 * Created by 赵航 on 2017/4/6.
 */

public class Sputiles {

    private static String name = Contenct.name;
    private static String psd1 = Contenct.pad;
    private static SharedPreferences mSp;


    //储存名字账号
    public static void saveName(String keyName){


        //如果有msp就不用初始化了
        if (mSp==null) {
            mSp = QQAppApolication.context.getSharedPreferences(keyName, Context.MODE_PRIVATE);
        }
        mSp.edit().putString(name, keyName).commit();
    }

    //获取账号信息
    public static String getName(){


        if (mSp==null){

            mSp = QQAppApolication.context.getSharedPreferences(name, Context.MODE_PRIVATE);

        }

        return mSp.getString(name,"");
    }
    //储存名字账号
    public static void savePsd(String psd){


        //如果有msp就不用初始化了
        if (mSp==null) {
            mSp = QQAppApolication.context.getSharedPreferences(psd, Context.MODE_PRIVATE);
        }
        mSp.edit().putString(psd1, psd).commit();
    }

    //获取账号信息
    public static String getPsd(){


        if (mSp==null){

            mSp = QQAppApolication.context.getSharedPreferences(psd1, Context.MODE_PRIVATE);

        }

        return mSp.getString(psd1,"");
    }

}
